package com.rocky_tech.biz;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.rocky_tech.framework.struts.action.Action;
import com.rocky_tech.framework.struts.form.ActionForm;
import com.rocky_tech.service.DecideService;
import com.rocky_tech.service.impl.DecideServiceImpl;
import com.rocky_tech.service.vo.MessageVO;

public class DecideAction implements Action {

	@Override
	public String execute(HttpServletRequest request,HttpServletResponse response,ActionForm form, Map<String, String> actionForwards) {
		String url = "";
		//String username = request.getParameter("username");
		DecideService decideService = new DecideServiceImpl();
		//调用具体的业务类
		Map<String,MessageVO> map = decideService.getVO(request,response,form,actionForwards);
		
		Set<String> set = map.keySet();
		for(Iterator<String> it = set.iterator();it.hasNext();){
			url = it.next();
			//System.out.println("2:url="+url);
			request.setAttribute("mess", map.get(url));
		}
		//传递到JSP页面上的数据
		return url;
	}
	
	

}
